{
const float dx = builder->dx;
const float dy = builder->dy;
- float width, height;
+ float scaled_width, scaled_height;
float scale_x;
float scale_y;
int render_target;
return TRUE;
}
- width = bounds->size.width;
- height = bounds->size.height;
scale_x = builder->scale_x;
scale_y = builder->scale_y;
{
const int max_texture_size = gsk_gl_driver_get_max_texture_size (self->gl_driver);
- width = ceilf (width * scale_x);
- if (width > max_texture_size)
+ scaled_width = ceilf (bounds->size.width * scale_x);
+ if (scaled_width > max_texture_size)
{
- scale_x *= (float)max_texture_size / width;
- width = max_texture_size;
+ scale_x *= (float)max_texture_size / scaled_width;
+ scaled_width = max_texture_size;
}
- height = ceilf (height * scale_y);
- if (height > max_texture_size)
+ scaled_height = ceilf (bounds->size.height * scale_y);
+ if (scaled_height > max_texture_size)
{
- scale_y *= (float)max_texture_size / height;
- height = max_texture_size;
+ scale_y *= (float)max_texture_size / scaled_height;
+ scaled_height = max_texture_size;
}
}
gsk_gl_driver_create_render_target (self->gl_driver,
- width, height,
+ scaled_width, scaled_height,
filter, filter,
&texture_id, &render_target);
if (gdk_gl_context_has_debug (self->gl_context))
render_target);
}
- viewport = GRAPHENE_RECT_INIT ((bounds->origin.x + dx) * scale_x,
- (bounds->origin.y + dy) * scale_y,
- width, height);
+ ops_transform_bounds_modelview (builder, bounds, &viewport);
+ /* Code above will scale the size with the scale we use in the render ops,
+ * but for the viewport size, we need our own size limited by the texture size */
+ viewport.size.width = scaled_width;
+ viewport.size.height = scaled_height;
init_projection_matrix (&item_proj, &viewport);
prev_render_target = ops_set_render_target (builder, render_target);
g_type_name_from_instance ((GTypeInstance *) child_node),
child_node,
k ++),
- width, height);
+ scaled_width, scaled_height);
}
#endif
--- /dev/null
+transform {
+ child: clip {
+ child: transform {
+ child: rounded-clip {
+ child: color {
+ bounds: 0 0 50 50;
+ color: rgb(255,0,0);
+ }
+ clip: 0 0 30 30 / 15;
+ }
+ transform: scale(10);
+ }
+ clip: 250 0 587 166;
+ }
+ transform: translate(0, 100);
+}
+
+color { color: black; bounds: 250 135 5 10; }
+color { color: black; bounds: 255 140 5 10; }
+color { color: black; bounds: 260 145 5 10; }
+color { color: black; bounds: 265 150 5 10; }
+color { color: black; bounds: 270 158 5 10; }
+color { color: black; bounds: 275 166 5 10; }
+color { color: black; bounds: 280 175 5 10; }
+color { color: black; bounds: 285 184 5 13; }
+color { color: black; bounds: 290 195 5 20; }
+color { color: black; bounds: 295 211 5 55; }